package com.example.md.mddemo.tabledemo.service;

import com.example.md.mddemo.tabledemo.tableroute.Router;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

import com.example.md.mddemo.tabledemo.User;
import com.example.md.mddemo.tabledemo.dao.UserDao;
@Service
public class UserServiceImpl implements UserService{

    @Resource
    private UserDao userDao;

    @Override
    public int insert(User user){
        return userDao.insert(user);
    }

    @Override
    public int insertSelective(User user){
        return userDao.insertSelective(user);
    }

    @Override
    public int insertList(List<User> users){
        return userDao.insertList(users);
    }

    @Override
    public int update(User user){
        return userDao.update(user);
    }

    @Override
    public int insert(User user1, String str) {
        return userDao.insert(user1,str);
    }

    @Override
    public List<User> findByName(String name, String tableName) {
        return userDao.findByName(name,tableName);
    }

    @Override
    @Router(companyCode = "1_a")
    public User findById(User user){

        return userDao.findById(user);
    }


}
